package com.baboba.rummy.web.client.game;

import com.baboba.rummy.game.GameManager;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;

public class ActionToolbar extends Composite {
	private FlexTable topPanel;
	
	public ActionToolbar(){
		topPanel = new FlexTable();
		topPanel.setWidth("100%");
		
		Button newGameButton = new Button("New Game");
		newGameButton.addClickHandler(new ClickHandler(){

			@Override
			public void onClick(ClickEvent event) {
				GameManager.getInstance().createNewGame();
			}
		
		});
		
		Button newRoundButton = new Button("New Round");
		newRoundButton.addClickHandler(new ClickHandler(){

			@Override
			public void onClick(ClickEvent event) {
				GameManager.getInstance().createNewRound();
			}
			
		});
		
		topPanel.setWidget(0, 0, newGameButton);
		topPanel.setWidget(0, 1, newRoundButton);
		this.initWidget(topPanel);
	}
}
